.class public Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;
.super Ljava/lang/Object;
.source "MarkerMovingFacade.java"


# instance fields
.field private ctx:Landroid/content/Context;

.field private currentMarkerPoint:Landroid/graphics/Point;

.field private data:Llt/noframe/gpsfarmguide/Data;

.field private doCalculations:Z

.field private doCalculationsRunning:Z

.field private dragging:Z

.field private drawingStateSaved:Z

.field private handler:Landroid/os/Handler;

.field private markerID:I

.field private moveMap:Z

.field private moveMapRunning:Z

.field private offset_x:I

.field private offset_y:I

.field private screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    .line 39
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 23
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object v0

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    const/4 v0, 0x0

    .line 24
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_x:I

    .line 25
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_y:I

    .line 26
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    .line 27
    iput v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->markerID:I

    .line 28
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap:Z

    .line 30
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMapRunning:Z

    .line 31
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculations:Z

    .line 32
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculationsRunning:Z

    .line 33
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->drawingStateSaved:Z

    .line 40
    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->ctx:Landroid/content/Context;

    .line 41
    new-instance v0, Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-direct {v0, p1}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    .line 42
    new-instance p1, Landroid/os/Handler;

    invoke-direct {p1}, Landroid/os/Handler;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->handler:Landroid/os/Handler;

    return-void
.end method

.method static synthetic access$002(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;Z)Z
    .locals 0

    .line 21
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMapRunning:Z

    return p1
.end method

.method static synthetic access$100(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Z
    .locals 0

    .line 21
    iget-boolean p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap:Z

    return p0
.end method

.method static synthetic access$200(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Llt/noframe/gpsfarmguide/utils/ScreenHelper;
    .locals 0

    .line 21
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    return-object p0
.end method

.method static synthetic access$300(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Llt/noframe/gpsfarmguide/Data;
    .locals 0

    .line 21
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    return-object p0
.end method

.method static synthetic access$400(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Landroid/graphics/Point;
    .locals 0

    .line 21
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->currentMarkerPoint:Landroid/graphics/Point;

    return-object p0
.end method

.method static synthetic access$500(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)I
    .locals 0

    .line 21
    iget p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->markerID:I

    return p0
.end method

.method static synthetic access$600(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Landroid/content/Context;
    .locals 0

    .line 21
    iget-object p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->ctx:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic access$702(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;Z)Z
    .locals 0

    .line 21
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculationsRunning:Z

    return p1
.end method

.method static synthetic access$800(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)Z
    .locals 0

    .line 21
    iget-boolean p0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculations:Z

    return p0
.end method


# virtual methods
.method public doCalculations()V
    .locals 1

    .line 180
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculationsRunning:Z

    if-nez v0, :cond_0

    .line 181
    new-instance v0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade$2;

    invoke-direct {v0, p0}, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade$2;-><init>(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)V

    .line 201
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    :cond_0
    return-void
.end method

.method public down(Landroid/view/MotionEvent;)V
    .locals 5

    .line 50
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    if-eqz v0, :cond_0

    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    if-nez v0, :cond_0

    .line 51
    new-instance v0, Landroid/graphics/Point;

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v1

    float-to-int v1, v1

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result v2

    float-to-int v2, v2

    invoke-direct {v0, v1, v2}, Landroid/graphics/Point;-><init>(II)V

    .line 52
    iget-object v1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v1

    invoke-virtual {v1}, Lcom/google/android/gms/maps/GoogleMap;->getProjection()Lcom/google/android/gms/maps/Projection;

    move-result-object v1

    iget-object v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v2

    invoke-virtual {v2}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/google/android/gms/maps/Projection;->toScreenLocation(Lcom/google/android/gms/maps/model/LatLng;)Landroid/graphics/Point;

    move-result-object v1

    .line 54
    iget v2, v0, Landroid/graphics/Point;->y:I

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getKiekAtmestiPx()I

    move-result v3

    add-int/2addr v2, v3

    iput v2, v0, Landroid/graphics/Point;->y:I

    .line 56
    iget-object v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getXdpi()I

    move-result v2

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getYdpi()I

    move-result v3

    iget-object v4, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-virtual {v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getYdpi2()I

    move-result v4

    invoke-static {v0, v1, v2, v3, v4}, Llt/noframe/gpsfarmguide/utils/Mathematics;->isMarkerTouched(Landroid/graphics/Point;Landroid/graphics/Point;III)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 57
    invoke-virtual {p1}, Landroid/view/MotionEvent;->getPointerCount()I

    move-result p1

    const/4 v2, 0x2

    if-ge p1, v2, :cond_0

    .line 58
    iget p1, v0, Landroid/graphics/Point;->x:I

    iget v2, v1, Landroid/graphics/Point;->x:I

    sub-int/2addr p1, v2

    iput p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_x:I

    .line 59
    iget p1, v0, Landroid/graphics/Point;->y:I

    iget v0, v1, Landroid/graphics/Point;->y:I

    sub-int/2addr p1, v0

    iput p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_y:I

    const/4 p1, 0x1

    .line 60
    iput-boolean p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    .line 61
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->getUiSettings()Lcom/google/android/gms/maps/UiSettings;

    move-result-object p1

    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/UiSettings;->setScrollGesturesEnabled(Z)V

    .line 62
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->getUiSettings()Lcom/google/android/gms/maps/UiSettings;

    move-result-object p1

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/UiSettings;->setZoomGesturesEnabled(Z)V

    :cond_0
    return-void
.end method

.method public move(Landroid/view/MotionEvent;)V
    .locals 6

    .line 72
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    if-eqz v0, :cond_3

    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    if-eqz v0, :cond_3

    .line 73
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->drawingStateSaved:Z

    const/4 v1, 0x0

    const/4 v2, 0x1

    if-nez v0, :cond_1

    .line 74
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->saveState()V

    .line 75
    iput-boolean v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->drawingStateSaved:Z

    .line 76
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getTool()I

    move-result v0

    const/4 v3, 0x2

    if-ne v0, v3, :cond_0

    .line 77
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0, v1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->setColor(I)V

    .line 78
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-virtual {v0}, Lcom/google/android/gms/maps/model/Marker;->getSnippet()Ljava/lang/String;

    move-result-object v0

    const-string v3, "marker"

    invoke-virtual {v0, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    const/4 v3, 0x3

    if-le v0, v3, :cond_0

    .line 79
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v3

    invoke-virtual {v0, v3}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->removeSideMidPoints(Lcom/google/android/gms/maps/model/Marker;)V

    .line 81
    :cond_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getMarkers()Ljava/util/List;

    move-result-object v0

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v3}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v3

    invoke-interface {v0, v3}, Ljava/util/List;->indexOf(Ljava/lang/Object;)I

    move-result v0

    iput v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->markerID:I

    .line 84
    :cond_1
    new-instance v0, Landroid/graphics/Point;

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F

    move-result v3

    float-to-int v3, v3

    iget v4, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_x:I

    sub-int/2addr v3, v4

    invoke-virtual {p1}, Landroid/view/MotionEvent;->getY()F

    move-result p1

    float-to-int p1, p1

    iget v4, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->offset_y:I

    sub-int/2addr p1, v4

    iget-object v4, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    invoke-virtual {v4}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->getKiekAtmestiPx()I

    move-result v4

    add-int/2addr p1, v4

    invoke-direct {v0, v3, p1}, Landroid/graphics/Point;-><init>(II)V

    iput-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->currentMarkerPoint:Landroid/graphics/Point;

    .line 85
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->getProjection()Lcom/google/android/gms/maps/Projection;

    move-result-object p1

    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->currentMarkerPoint:Landroid/graphics/Point;

    invoke-virtual {p1, v0}, Lcom/google/android/gms/maps/Projection;->fromScreenLocation(Landroid/graphics/Point;)Lcom/google/android/gms/maps/model/LatLng;

    move-result-object p1

    .line 86
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/google/android/gms/maps/model/Marker;->setPosition(Lcom/google/android/gms/maps/model/LatLng;)V

    .line 87
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->screenHelper:Llt/noframe/gpsfarmguide/utils/ScreenHelper;

    iget-object v3, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->ctx:Landroid/content/Context;

    iget-object v4, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v4}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v4

    invoke-virtual {v4}, Lcom/google/android/gms/maps/model/Marker;->getPosition()Lcom/google/android/gms/maps/model/LatLng;

    move-result-object v4

    iget-object v5, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v5}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object v5

    invoke-virtual {v0, v3, v4, v5}, Llt/noframe/gpsfarmguide/utils/ScreenHelper;->slinkimasSonan(Landroid/content/Context;Lcom/google/android/gms/maps/model/LatLng;Lcom/google/android/gms/maps/GoogleMap;)Z

    move-result v0

    if-nez v0, :cond_2

    .line 88
    iput-boolean v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap:Z

    .line 89
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap()V

    goto :goto_0

    .line 92
    :cond_2
    iput-boolean v1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap:Z

    .line 93
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->markerID:I

    invoke-virtual {v0, v1, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->updatePoint(ILcom/google/android/gms/maps/model/LatLng;)V

    .line 95
    :goto_0
    iget-object v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v0}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object v0

    iget v1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->markerID:I

    invoke-virtual {v0, v1, p1}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->updatePoint(ILcom/google/android/gms/maps/model/LatLng;)V

    .line 96
    iput-boolean v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculations:Z

    .line 97
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculations()V

    :cond_3
    return-void
.end method

.method public moveMap()V
    .locals 1

    .line 141
    iget-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMapRunning:Z

    if-nez v0, :cond_0

    .line 143
    new-instance v0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade$1;

    invoke-direct {v0, p0}, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade$1;-><init>(Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;)V

    .line 171
    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    :cond_0
    return-void
.end method

.method public up(Landroid/view/MotionEvent;)V
    .locals 4

    .line 106
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object p1

    const/4 v0, 0x0

    if-eqz p1, :cond_1

    iget-boolean p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    const/4 v1, 0x1

    if-ne p1, v1, :cond_1

    .line 107
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getTool()I

    move-result p1

    const/4 v2, 0x2

    if-ne p1, v2, :cond_0

    .line 108
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    const v3, 0x3f00ff00

    invoke-virtual {p1, v3}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->setColor(I)V

    .line 109
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->getPoints()Ljava/util/List;

    move-result-object p1

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result p1

    if-le p1, v2, :cond_0

    iget-boolean p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->drawingStateSaved:Z

    if-eqz p1, :cond_0

    .line 110
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    iget-object v2, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {v2}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object v2

    invoke-virtual {p1, v2}, Llt/noframe/gpsfarmguide/models/MeasuringModel;->insertSideMidPoints(Lcom/google/android/gms/maps/model/Marker;)V

    .line 111
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getSelectedMarker()Lcom/google/android/gms/maps/model/Marker;

    move-result-object p1

    const-string v2, "marker"

    invoke-virtual {p1, v2}, Lcom/google/android/gms/maps/model/Marker;->setSnippet(Ljava/lang/String;)V

    .line 112
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getAddDeleteState()Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;

    move-result-object p1

    new-instance v2, Llt/noframe/gpsfarmguide/states/add_delete_states/DeleteState;

    invoke-direct {v2}, Llt/noframe/gpsfarmguide/states/add_delete_states/DeleteState;-><init>()V

    invoke-virtual {p1, v2}, Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteStatesController;->setState(Llt/noframe/gpsfarmguide/states/add_delete_states/AddDeleteState;)V

    .line 115
    :cond_0
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->drawingStateSaved:Z

    .line 116
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->dragging:Z

    .line 117
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->getUiSettings()Lcom/google/android/gms/maps/UiSettings;

    move-result-object p1

    invoke-virtual {p1, v1}, Lcom/google/android/gms/maps/UiSettings;->setScrollGesturesEnabled(Z)V

    .line 118
    iget-object p1, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->data:Llt/noframe/gpsfarmguide/Data;

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getMap()Lcom/google/android/gms/maps/GoogleMap;

    move-result-object p1

    invoke-virtual {p1}, Lcom/google/android/gms/maps/GoogleMap;->getUiSettings()Lcom/google/android/gms/maps/UiSettings;

    move-result-object p1

    invoke-virtual {p1, v1}, Lcom/google/android/gms/maps/UiSettings;->setZoomGesturesEnabled(Z)V

    .line 120
    :cond_1
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->moveMap:Z

    .line 121
    iput-boolean v0, p0, Llt/noframe/gpsfarmguide/utils/MarkerMovingFacade;->doCalculations:Z

    .line 124
    :try_start_0
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    if-eqz p1, :cond_2

    .line 125
    invoke-static {}, Llt/noframe/gpsfarmguide/Data;->getInstance()Llt/noframe/gpsfarmguide/Data;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/Data;->getCurrent_measuring()Llt/noframe/gpsfarmguide/models/MeasuringModel;

    move-result-object p1

    invoke-virtual {p1}, Llt/noframe/gpsfarmguide/models/AbstractMeasuringModel;->doCalculations()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_2
    return-void
.end method
